@extends('Admin.layout.layout')
@section('title','问题列表')
@section('con')
<div class="panel-body"> 
	<div class="dataTable_wrapper"> 
		<div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
			<div class="row">
			<!-- 搜索表单 -->
			<form action="{{url('/admin/question/list')}}" method="get">
				<div class="col-sm-6">
					<div class="dataTables_length" id="dataTables-example_length">
						<label>Show 
							<select name="num" aria-controls="dataTables-example" class="form-control input-sm">
								<option value="10" @if(!empty($data['num']) && $data['num']==10) selected @endif>10</option>
								<option value="25" @if(!empty($data['num']) && $data['num']==25) selected @endif>25</option>
								<option value="50" @if(!empty($data['num']) && $data['num']==50) selected @endif>50</option>
								<option value="100"@if(!empty($data['num']) && $data['num']==100) selected @endif>100</option>
							</select> entries
						</label>
					</div>
				</div>

				<div class="col-sm-6">
					<div id="dataTables-example_filter" class="dataTables_filter">
						<label>Search:<input name="keywords" value="{{$data['keywords'] or ''}}" class="form-control input-sm" placeholder="" aria-controls="dataTables-example" type="search" /></label>
						<button class="btn btn-primary">搜索</button>
					</div>
				</div>
			</form>
			</div>

			<div class="row">
				<div class="col-sm-12">
					<table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" role="grid" aria-describedby="dataTables-example_info"> 
						<thead> 
							<tr role="row">
								<th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 175px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">ID</th>
								<th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 203px;" aria-label="Browser: activate to sort column ascending">问题名</th>
								<th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 184px;" aria-label="Platform(s): activate to sort column ascending">提问者</th>
								<th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 108px;" aria-label="CSS grade: activate to sort column ascending">操作</th>
							</tr> 
						</thead> 
						<tbody> 
						@foreach($questions as $k=>$v)
							<tr class="gradeA odd" role="row"> 
								<td class="sorting_1">{{$v->id}}</td> 
								<td>{{$v->question_name}}</td> 
								<td>{{$v->user_id}}</td> 
								<td class="center"><a href="{{url('/admin/question/delete',['id'=>$v->id])}}">删除</a>|<a href="{{url('/admin/answer/check',['id'=>$v->id])}}">查看回答</a></td> 
							</tr>
						@endforeach
						</tbody> 
					</table>
				</div>
			</div>
			<div class="row">
				<div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
					{!! $questions->appends($data)->render() !!}
				</div>
			</div>
		</div> 
	</div> 
</div>
@endsection